-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactions: Fix waitFor
behavior while debugging
#18460
Interactions: Fix waitFor
behavior while debugging
#18460
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 73416f7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
waitFor
behavior while debuggingwaitFor
behavior while debugging
…callbacks up to the parent rather than forwarding it to the next interceptable call
1fcbb72
to
dcd77df
Compare
3d3f90f
to
d7e5293
Compare
Edit: Disregard this comment. Tested with wrong setup. Awesome stuff @ghengeveld ! I noticed a possible issue in this story Issue: 1 - waitFor is not visible, so it looks like the two last steps are child of userEvent Steps to reproduce 1 - Click on Go to Start |
@yannbf you need storybookjs/testing-library#23 as well. |
Thanks! I updated the "How to test" section to reflect that. |
I just tested many scenarios and they all were pretty good, awesome work @ghengeveld 🙌 |
waitFor
behavior while debuggingwaitFor
behavior while debugging
@shilman This is ready to merge. I'll leave that up to your discretion. |
Will this be picked into 6.5 as well, or does it rely on 7.0 changes? |
This was just released in 7.0.0-alpha.3 and the corresponding fix of testing-library was released in 14.0.0-next.0 and the idea is to test it out enough to see if we bring it back to 6.5! |
Awesome, I was able to hack it into my 6.5 vite project, and it seems like it's working great. I did find one potential bug, though: await expect(newRoles).toEqual(expect.arrayContaining([expect.objectContaining({ name: 'New role' })])); crashes the whole storybook app (white screen of death) with the following error in the console:
|
That looks like a key prop warming, but I doubt fixing it will resolve the white screen of death. Will investigate anyway. |
Fixed here: #18499 |
This should be backported to 6.5 along with #18499 in order to support storybookjs/testing-library#23 |
Issue: #16872
What I did
Don't intercept calls inside callbacks, and bubble exceptions inside callbacks up to the parent rather than forwarding it to the next interceptable call. Show child interactions in log and display errors in the appropriate place. I got rid of the
forwardedException
concept entirely because it didn't (and can't) work with chained interactions (a().b()
). Instead, any interaction that raises an exception will now appear in the log, even if it's not interceptable.How to test
1 - Install @storybook/testing-library0.0.14--canary.23.ac6b056.0 in the
oficcial-example
project2 - Run
yarn start
If your answer is yes to any of these, please make sure to include it in your PR.